import 'package:flutter/material.dart';
import 'package:demo190804_route_nav/demo1_routers/RouteBasicDemo.dart';
import 'package:demo190804_route_nav/demo1_routers/customerRoute.dart';
import 'package:demo190804_route_nav/demo1_routers/Demo_Register.dart';

void main() => runApp(MyApp4());

// 路由的基本使用
class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
      routes: <String, WidgetBuilder>{
        '/a': (BuildContext context) => MyPage(title: 'This is Page A'),
        '/b': (BuildContext context) => MyPage(title: 'This is Page B'),
        '/c': (BuildContext context) => MyPage(title: 'This is Page C'),
      },
    );
  }
}

//自定义路由
class MyApp3 extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: '自定义路由',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: CustomRoute(title: '自定义路由'),
    );
  }

}

// real world example
class MyApp4 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: ' real world example',
      initialRoute: '/signUp',
      routes: {
        '/': (BuildContext context) => HomePage(),
        '/signUp': (BuildContext context) => SignUpPage(),
      },
    );
  }



}
